package com.myproject.mall.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.myproject.mall.domain.enums.CouponStatus;
import com.myproject.mall.domain.enums.CouponType;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@TableName("scmall_coupon")
@Schema(description = "优惠券信息")
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class CouponInfo {
    @Schema(description = "优惠券ID")
    @TableId(value = "coupon_id", type = IdType.AUTO)
    private Integer id;

    @Schema(description = "优惠券名称")
    @TableField(value = "coupon_title")
    private String title;

    @Schema(description = "优惠券发布者ID")
    @TableField(value = "user_id")
    private String userId;

    @Schema(description = "优惠券使用门槛")
    @TableField(value = "coupon_actual_value")
    private Integer actualValue;

    @Schema(description = "优惠券减免金额")
    @TableField(value = "coupon_reduce_value")
    private Integer reduceValue;

    @Schema(description = "优惠券类型")
    @TableField(value = "coupon_type")
    private CouponType type;

    @Schema(description = "优惠券状态")
    @TableField(value = "coupon_status")
    private CouponStatus status;

    @Schema(description = "优惠券开始时间")
    @TableField(value = "coupon_start_time")
    private LocalDateTime startTime;

    @Schema(description = "优惠券结束时间")
    @TableField(value = "coupon_end_time")
    private LocalDateTime endTime;

    @Schema(description = "优惠券创建时间")
    @TableField(value = "coupon_create_time")
    private LocalDateTime createTime;

    @Schema(description = "优惠券更新时间")
    @TableField(value = "coupon_update_time")
    private LocalDateTime updateTime;

}
